UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hNrruggZPa3tUjRPB8dpASizS7kNLt3Fw4hidSwUHAk='
WHERE
key_id = '8d28393ba960fc43dc984f2b34b91e510852523eb984dd953bf8281611bd5ad0'
AND (
token = 'hNrruggZPa3tUjRPB8dpASizS7kNLt3Fw4hidSwUHAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)