UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ki4fgmgIdsNY8zpZFm6ykRUAkRPZ7uyh6KnrLo3c92I=' 
WHERE 
  key_id = '903b86f62847f74da330abeb62789253ec6abb98ef904a0ab0c4b6f7e2ffd6f6' 
  AND (
    token = 'Ki4fgmgIdsNY8zpZFm6ykRUAkRPZ7uyh6KnrLo3c92I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020