UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dwjEud57Ie4r2EFpru9nhkFh4TJUQtBrZ3PLCQzTSoU='
WHERE
key_id = '6f46a342cce39745b8460c2610ae2af8287813418431d77f3201cdb47c088e1a'
AND (
token = 'dwjEud57Ie4r2EFpru9nhkFh4TJUQtBrZ3PLCQzTSoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)