UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IgIfjA1H+1OJLm1t3vmfjO3QAvxl/tWspwuuBJWNSus=' 
WHERE 
  key_id = '851ac483dc5b70deb6305698d0414a86c9eafe54c3b6deffea4e6ad5d02c6673' 
  AND (
    token = 'IgIfjA1H+1OJLm1t3vmfjO3QAvxl/tWspwuuBJWNSus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019