UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qbbN1LssbwI55UCAOkbvxRcqKxdyc27TApvIGCsNexA='
WHERE
key_id = '89a1995ab95b92d32f49e514dcf062e80fb736cdd638f9f775964b3a09f81eb3'
AND (
token = 'qbbN1LssbwI55UCAOkbvxRcqKxdyc27TApvIGCsNexA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)