UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+I8VtCX3pFapRxf0vo9WRlzxGcT1PUVM+U12lcdaURE=' 
WHERE 
  key_id = 'aadd2b91ea1b14410376c809a3f6af625094aa382335f40700e6aaf82bf12fc2' 
  AND (
    token = '+I8VtCX3pFapRxf0vo9WRlzxGcT1PUVM+U12lcdaURE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027