UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dQIRmycRWSJn/zj2zC3ekrvDHWoHql9ntYDPKRSNzCQ=' 
WHERE 
  key_id = '3c3ece1ff339895278f97481c02291cdbb316fd9ac31daa15d2963606bad34bd' 
  AND (
    token = 'dQIRmycRWSJn/zj2zC3ekrvDHWoHql9ntYDPKRSNzCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051