UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w0Qwrwnry70cauHlffJItadE+Je7uWIyEBydk9r4J8Y='
WHERE
key_id = 'ff4b5bda821beaf5821405810b72599e7dc17e3bb9eb65ef4f1ab483071c4629'
AND (
token = 'w0Qwrwnry70cauHlffJItadE+Je7uWIyEBydk9r4J8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)