UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L4kqUsBcFNkWYfOemfMs54azJyRx+nSROU0lZLpqwp4=' 
WHERE 
  key_id = 'fba73c22d6df2575b116c470926ca32a9ed25573fc5a6293e914d01d9e0011b3' 
  AND (
    token = 'L4kqUsBcFNkWYfOemfMs54azJyRx+nSROU0lZLpqwp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032