UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xL0zxP9oiY1eFmR4ikshABVEyQWh6i4UF36x6VsxTus=' 
WHERE 
  key_id = '9b845794769d0f7a70c63f0b07176ef4cfaa905cedb2b81273268fa55e18b6cb' 
  AND (
    token = 'xL0zxP9oiY1eFmR4ikshABVEyQWh6i4UF36x6VsxTus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031