UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '44HPAKhDy2/sQUxppFD8amv9pdT5hyQWLQQaCKYM8A8='
WHERE
key_id = 'fb9f276ca2733523ffd19f282ad79f58e2566f670345068557767b50e252a2fc'
AND (
token = '44HPAKhDy2/sQUxppFD8amv9pdT5hyQWLQQaCKYM8A8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)