UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/v6Hsp4fgG+K5pfJRFokqiA0f4o1t5DOLE9y1qLM5o=' 
WHERE 
  key_id = '70cc4dad9216edf3133c49b5726f54e10ddd147513b5750498ce8c34de434638' 
  AND (
    token = 'E/v6Hsp4fgG+K5pfJRFokqiA0f4o1t5DOLE9y1qLM5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013