UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm2qYQ0OAKyhuXRW762sgIVVSB+qMW2pbDnLwbU/cX2A='
WHERE
key_id = '5af02cb3877806ae36bf57c8af4922a4236d8b8e177c8b9d73a07fbf41846e92'
AND (
token = 'm2qYQ0OAKyhuXRW762sgIVVSB+qMW2pbDnLwbU/cX2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)