UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bYbA/lbCYOzbkFJ3S7MpihnkuqG1UN1QC2kHotMM7So=' 
WHERE 
  key_id = '28518319d2c202e3c7a84c5f102aca9b78e91a78abe1108310f2ec9476b7a26e' 
  AND (
    token = 'bYbA/lbCYOzbkFJ3S7MpihnkuqG1UN1QC2kHotMM7So=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023