UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uA6K+pp+bEDafcHJtRNEfj9wNs8QnwLAR2YS48Kz9iM=' 
WHERE 
  key_id = '7e38d8d9c553b6d4423d65a4a013137af42eb96a6d59eed3af0bdf2231ac1f3a' 
  AND (
    token = 'uA6K+pp+bEDafcHJtRNEfj9wNs8QnwLAR2YS48Kz9iM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044