UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3fBN1EZo1wg5w74tKjA8TxQI8PkhWH0Wm0fo7GV4LZo='
WHERE
key_id = '41d4f477d30cb9103f427c7fa73be6bbd94005a1653a01c6ab1a0355e29f2e03'
AND (
token = '3fBN1EZo1wg5w74tKjA8TxQI8PkhWH0Wm0fo7GV4LZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)