UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ebYmnu2jD3M5tK0/QU5GAGZ/XVYBF647ky2jMYW+dQ='
WHERE
key_id = '3bc4f773d4ae464f56664a721c4259b9fc95c11fb31ee91659e1fa00db825507'
AND (
token = '+ebYmnu2jD3M5tK0/QU5GAGZ/XVYBF647ky2jMYW+dQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)