UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lX5mDV7CEi5v9bx6S/jxMf5k+1zPOmReD01jWaf5N+8='
WHERE
key_id = '0dde210713c9a5a9eebb6b63e7c61f8bea75883a8adc9306fc4b21d56368fbcd'
AND (
token = 'lX5mDV7CEi5v9bx6S/jxMf5k+1zPOmReD01jWaf5N+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)