UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sjnQySXyo5dYQKjKfZmBCw2yEMzgUoaFHpjyaMoVhJc=' 
WHERE 
  key_id = 'a596d3a2d975ae6d3d09e479ae3dfc1a360e634c1f4bd286c0bdb8f324a2010e' 
  AND (
    token = 'sjnQySXyo5dYQKjKfZmBCw2yEMzgUoaFHpjyaMoVhJc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026