UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zeS5RcMZR/dcqFX/RbuqLRZVnNS7CSJm+PHDOYbh9wQ=' 
WHERE 
  key_id = '1980f22bf4be0df437a759fec859630bd8c246fa060c0dbaccc0343c3008f974' 
  AND (
    token = 'zeS5RcMZR/dcqFX/RbuqLRZVnNS7CSJm+PHDOYbh9wQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036