UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cRQ82bw6zhxx7o2x1H0cF/cMbHSTlscmtaoJuaaLTos='
WHERE
key_id = '4cd146c2565646ddee678846cd16985fd6786acbd001d67651d104d61ed7075c'
AND (
token = 'cRQ82bw6zhxx7o2x1H0cF/cMbHSTlscmtaoJuaaLTos='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)