UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yI76mPSTIk6ysEiCLEIWWqfO1G0yXCAPj7qwWLd/LYo='
WHERE
key_id = 'bcd7e5cda595840bf6a6c8131faf489c1e43b825920b710f1c0fa42cbf51c994'
AND (
token = 'yI76mPSTIk6ysEiCLEIWWqfO1G0yXCAPj7qwWLd/LYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)