UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fpv8re8HI3BBEl6PMFE3ZGNuQkZmrGL0AC3q8JoR3/c=' 
WHERE 
  key_id = 'eec56835df2569ae6c6dbedd129a2d850291d7167a185b18ae29c98a8869f296' 
  AND (
    token = 'fpv8re8HI3BBEl6PMFE3ZGNuQkZmrGL0AC3q8JoR3/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057