UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IB/dFbEuHa0EI3NyQToOeVTTxJj8AO7R/5z8vjENHVM='
WHERE
key_id = '5868b9502fbfd7df00fafecb3cba53ff17b7f901a842d25d4649266a29c39c15'
AND (
token = 'IB/dFbEuHa0EI3NyQToOeVTTxJj8AO7R/5z8vjENHVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)