UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2eM3hvLGHqVxYN7BVHZrhHhNhClU1Mn+eT7Ru0df/8M=' 
WHERE 
  key_id = '21276366d255fc89ee8d0fa01956d116be793451f6512cf7654dca34a645c6ae' 
  AND (
    token = '2eM3hvLGHqVxYN7BVHZrhHhNhClU1Mn+eT7Ru0df/8M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027