UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94jROIlpS/ljEyjTDwdraa6XE0xNGApck4Gn2ZZ//QM=' 
WHERE 
  key_id = '3a35a80be0b9885013a6fae828e651c4752e4347f8664f690fc27ee0f782567a' 
  AND (
    token = '94jROIlpS/ljEyjTDwdraa6XE0xNGApck4Gn2ZZ//QM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026