UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P5PxzHyz15OGExwefyaVGJMnmJ8JbPH0c7MTAeaDCwk=' 
WHERE 
  key_id = '4e01666abc3a00d1dafaeea2e177d290779a53ec4ae594c49bf0d6f337f498c5' 
  AND (
    token = 'P5PxzHyz15OGExwefyaVGJMnmJ8JbPH0c7MTAeaDCwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038