UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zHAm7PjdZJMO02F+r8E2siHnJfo7kXUkIpA9qLSR/NQ=' 
WHERE 
  key_id = 'fe03d9c8b4b73facb574c5a5b59c3337a536dc3582495ab3c1875ff7a0ebf600' 
  AND (
    token = 'zHAm7PjdZJMO02F+r8E2siHnJfo7kXUkIpA9qLSR/NQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034