UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4slP5c56C4BLJVhbthPCaHXmspve09pOQGI76sEG9hU='
WHERE
key_id = '7107c85042995d5b8dfe51854b802a03aab1e4000ff4386936167535dfda9ccf'
AND (
token = '4slP5c56C4BLJVhbthPCaHXmspve09pOQGI76sEG9hU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)