UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8bxwxRSIo2K3KuLRZI93Z8G0gKJLf1oB1483eGMkJJg=' 
WHERE 
  key_id = 'd959855500839e4adb57aaa4b5a7ed41d856ee60a8916a98ffd909873bc57e55' 
  AND (
    token = '8bxwxRSIo2K3KuLRZI93Z8G0gKJLf1oB1483eGMkJJg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034