UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmBOKpmWkBs4peglINfGx8/Pa7l4uAOpkEJQTea6d00='
WHERE
key_id = '5c1245eb8a3aaa36b7dacd905aa4c40657c42007b54eda17a72acfd47d731743'
AND (
token = 'UmBOKpmWkBs4peglINfGx8/Pa7l4uAOpkEJQTea6d00='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)