UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BijsMeXFWtbMfoEAiB1/eA8VjEx+xYajt4BG4EdCdEA=' 
WHERE 
  key_id = '1da3f1d2aff6729418dbdabdda0683717afb15177ddc377d9846903fb26c93a1' 
  AND (
    token = 'BijsMeXFWtbMfoEAiB1/eA8VjEx+xYajt4BG4EdCdEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019