UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'I1p41kqtUWPZPMw/Zn21BLFxYu5CnHWBwOexakmIyto=' 
WHERE 
  key_id = '9a3ca5729e8c10e11580d3dc0674c87377b391c1d687af724f607526b8ea0ca6' 
  AND (
    token = 'I1p41kqtUWPZPMw/Zn21BLFxYu5CnHWBwOexakmIyto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042