UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4FcHfHRVj36THGDd88MftAH1B05Lt0rltDRi2lBfJ3g='
WHERE
key_id = '412a9aebd111da6a307fbb24c9348dda8d41c9ae79a674feb3f0e86c90ee827e'
AND (
token = '4FcHfHRVj36THGDd88MftAH1B05Lt0rltDRi2lBfJ3g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)